//
//  CertificationViewController.m
//  HengYouCai
//
//  Created by ycgwl on 2017/5/1.
//  Copyright © 2017年 lwj. All rights reserved.
//

#import "CertificationViewController.h"

@interface CertificationViewController ()

@end

@implementation CertificationViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"实名认证";
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 44;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 2;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"CertificationCellID"];
    
    UILabel *titleLab = [cell viewWithTag:1001];
    UILabel *contentLab = [cell viewWithTag:1002];
    NSString *realName = [WLFileManager readUserDataForKey:kUserRealname];
    NSString *idCard = [WLFileManager readUserDataForKey:kUserIdCard];
    NSString *realName2 = [realName stringByReplacingCharactersInRange:NSMakeRange(1, realName.length-1) withString:@"**"];
    NSString *idCard2 = [idCard stringByReplacingCharactersInRange:NSMakeRange(6, idCard.length-10) withString:@"********"];

    contentLab.text = indexPath.row==0?realName2:idCard2;
    titleLab.text = indexPath.row==0?@"真实姓名":@"身份证号";
    return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
}
@end
